package com.example.xuanmei.data.api

import com.example.xuanmei.data.ApiResponse
import com.example.xuanmei.data.model.LoginResponse
import com.example.xuanmei.data.model.User
import com.example.xuanmei.data.model.Video
import retrofit2.Call
import retrofit2.http.*

interface ApiService {
    
    // 用户相关API
    @POST("api/user/login")
    fun login(
        @Body request: Map<String, String>
    ): Call<ApiResponse<LoginResponse>>
    
    @POST("api/user/register")
    fun register(
        @Body request: Map<String, String>
    ): Call<ApiResponse<LoginResponse>>
    
    @GET("api/user/info/{userId}")
    fun getUserInfo(@Path("userId") userId: Long): Call<ApiResponse<User>>
    
    // 视频相关API
    @GET("api/video/list")
    fun getVideoList(
        @Query("page") page: Int = 0,
        @Query("size") size: Int = 10
    ): Call<ApiResponse<List<Video>>>
    
    @GET("api/video/{videoId}")
    fun getVideoDetail(@Path("videoId") videoId: Long): Call<ApiResponse<Video>>
    
    @POST("api/video/{videoId}/like")
    fun likeVideo(@Path("videoId") videoId: Long): Call<ApiResponse<Void>>
    
    @GET("api/video/user/{userId}")
    fun getUserVideos(
        @Path("userId") userId: Long,
        @Query("page") page: Int = 0,
        @Query("size") size: Int = 10
    ): Call<ApiResponse<List<Video>>>
}
